<template>
	<div id="coming">
		<ul>
			<li v-for="item in comingData" :key="item.id">
				<div class="first"><img :src="item.img" ></div>
				<div class="second">
					<p class="title">{{item.title}}</p>
					<p><span class="score font-color">{{item.score}}</span>
					<span class="font-color">人想看</span></p>
					<p class="actors font-color">{{item.actors}}</p>
					<p class="font-color">未来30天内上映</p>
				</div>
				<div class="third"><button>预售</button></div>
			</li>
			
		</ul>
	</div>
</template>
<script>
	export default{
		name:'coming',
		methods:{
			getComingData(){
				var that=this;
				axios.get('/mock/comingData.json')
				// axios.get("/api/comingPlayData.json")
				.then(function(response){
					console.log(response);
					if(response.status == 200){
						if(response.data && response.data.comingData){
							that.comingData=response.data.comingData;
						}
					}
				})
				.catch(function(error){
					console.log(error);
				});
			}
		},
		created(){
			this.getComingData();
		},
		data(){
			return{
				comingData:[]
			}
		}
	}
</script>

<style scoped>
	#coming{
		width: 100%;
		padding-bottom: 35px;
	}
	img{
		width: 80px;
	}
	div{
		float: left;
	}
	.first{
		width: 25%;
		margin-bottom: 8px;
	}
	.second{
		width: 58%;
	}
	.actors{
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
	}
	.third{
		width: 15%;
		text-align: center;
		line-height: 100px;
	}
	li{
		overflow: hidden;
		margin: 10px;
		border-bottom: 1px solid #ccc;
	}
	.title{
		font-size: 18px;
		font-weight: bold;
	}
	p{
		line-height: 30px;
		margin-left: 5px;
	}
	.font-color{
		color: #666;
	}
	.score{
		font-size: 17px;
	}
	button{
		background: steelblue;
		width: 45px;
		height: 30px;
		border: none;
		color: white;
		border-radius: 5px;
	}
</style>
